package train48days;

import java.util.Arrays;
import java.util.Scanner;

public class mkdir {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
           while (sc.hasNext()){
               int n = sc.nextInt();
               sc.nextLine();
               String[] arr= new String[n];
               for (int i = 0; i < n; i++) {
                   arr[i] = sc.nextLine();
               }
               Arrays.sort(arr);
               boolean[] flag = new boolean[n];
               for (int i = 0; i < n-1; i++) {
                   if (arr[i].equals(arr[i+1])){
                       flag[i]=true;
                   }else if (arr[i].length()<arr[i+1].length()&&arr[i+1].contains(arr[i])&&arr[i+1].charAt(arr[i].length())=='/'){
                       flag[i] =true;
                   }
               }
               for (int i = 0; i < n; i++) {
                   if (!flag[i]) {
                       System.out.println("mkdir -p " + arr[i]);
                   }
               }
               System.out.println();
           }
    }
}
